
local config = {
    name = "test1",

    serv_list = {
        --{ip="192.168.200.19", port = 7001}
        {ip="192.168.200.19", port = 7001},
        {ip="192.168.200.19", port = 7002},
        {ip="192.168.200.19", port = 7003},

    },
}
local redis_cluster = require "resty.rediscluster"
local red = redis_cluster:new(config)
for i = 1, 2 do

    --red:init_pipeline()
    local ok ,err = red:auth("123456")
    local ok ,err = red:set("k1", "hello")
    local ok ,err = red:get("k1")
    local ok ,err = red:set("k2", "world")
    local ok ,err = red:get("k2")
  -- local results = red:commit_pipeline()
    local cjson = require "cjson"
    ngx.say(cjson.encode(results))
end
red:close()


